package com.ihr360.oneclick.dto;

import com.ihr360.commons.model.entity.StringIdWithTime;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import java.util.ArrayList;
import java.util.List;

/**
 * 员工名录
 *
 * @author tom
 * @date 17-12-18
 */
@Entity
@Table(name = "tab_staff_record", uniqueConstraints = {@UniqueConstraint(name = "tab_staff_record_c_i", columnNames = {"companyId", "idCardNo"}),
        @UniqueConstraint(name = "tab_staff_record_c_m", columnNames = { "companyId", "mobileNo"})})
public class StaffRecordDto extends StringIdWithTime {

    /**
     * AppUser.id
     */
    @Column(length = 40)
    private String appUserId;

    @Column(length = 40)
    private String companyId;

    @Column(length = 20)
    private String staffName;

    @Column(length = 20)
    private String mobileNo;

    @Column(length = 100)
    private String wechatOpenId;

    @Column(length = 50)
    private String idCardNo;

    /**
     * 允许查看一键发布数据
     */
    @Column
    private Boolean allow;

    @OneToMany(mappedBy = "staffRecord")
    private List<UserStaffRecordDto> userStaffRecordList = new ArrayList<>();

    public String getAppUserId() {
        return appUserId;
    }

    public void setAppUserId(String appUserId) {
        this.appUserId = appUserId;
    }

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public String getStaffName() {
        return staffName;
    }

    public void setStaffName(String staffName) {
        this.staffName = staffName;
    }

    public String getMobileNo() {
        return mobileNo;
    }

    public void setMobileNo(String mobileNo) {
        this.mobileNo = mobileNo;
    }

    public String getIdCardNo() {
        return idCardNo;
    }

    public void setIdCardNo(String idCardNo) {
        this.idCardNo = idCardNo;
    }

    public Boolean getAllow() {
        return allow;
    }

    public void setAllow(Boolean allow) {
        this.allow = allow;
    }

    public String getWechatOpenId() {
        return wechatOpenId;
    }

    public void setWechatOpenId(String wechatOpenId) {
        this.wechatOpenId = wechatOpenId;
    }

    public List<UserStaffRecordDto> getUserStaffRecordList() {
        return userStaffRecordList;
    }

    public void setUserStaffRecordList(List<UserStaffRecordDto> userStaffRecordList) {
        this.userStaffRecordList = userStaffRecordList;
    }
}
